package main.java.enity;

import java.io.Serializable;
import javax.persistence.*;

import java.util.List;
import javax.persistence.FetchType;

/**
 * The persistent class for the student database table.
 * 
 */
@Entity
@Table(name = "student")
public class Student implements Serializable {
	private static final long serialVersionUID = 1L;
	private int studentId;
	private String address;
	private String email;
	private String name;
	private List<ClassDetail> classDetails;

	public Student() {
	}

	@Id
	@GeneratedValue(strategy = GenerationType.IDENTITY)
	@Column(name = "STUDENT_ID")
	public int getStudentId() {
		return this.studentId;
	}

	public void setStudentId(int studentId) {
		this.studentId = studentId;
	}

	@Column(name = "ADDRESS")
	public String getAddress() {
		return this.address;
	}

	public void setAddress(String address) {
		this.address = address;
	}

	@Column(name = "EMAIL")
	public String getEmail() {
		return this.email;
	}

	public void setEmail(String email) {
		this.email = email;
	}

	@Column(name = "NAME")
	public String getName() {
		return this.name;
	}

	public void setName(String name) {
		this.name = name;
	}

	// bi-directional many-to-one association to ClassDetail
	@OneToMany(mappedBy = "student", fetch = FetchType.EAGER)
	public List<ClassDetail> getClassDetails() {
		return this.classDetails;
	}

	public void setClassDetails(List<ClassDetail> classDetails) {
		this.classDetails = classDetails;
	}

}